// 引入sxk-button组件
import SxkButton from './sxk-button/index.vue'
import SxkInput from './sxk-input/index.vue'
import SxkIcon from './sxk-icon/index.vue'
import SxkDialog from './sxk-dialog/index.vue'
import SxkRadio from './sxk-radio/index.vue'
import SxkRadioGroup from './sxk-radio-group/index.vue'
import './font/iconfont.css'

const compontents = [
  SxkButton,
  SxkInput,
  SxkIcon,
  SxkDialog,
  SxkRadio,
  SxkRadioGroup
]

// 批量注册
const install = Vue => {
  compontents.forEach(com => {
    Vue.component(com.name, com)
  })
}
// 判断是否直接引入文件，如果是，就不用调用Vue.use()
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

// 这个方法可以被use调用
export default install
